/* 
 * File:   QTimeSlice.h
 * Author: matt
 *
 * Created on 16 May 2010, 21:35
 */

#ifndef _QTIMESLICE_H
#define	_QTIMESLICE_H
#include <QWidget>
#include <QImage>
#include <QList>
#include <QLayout>
#include <QSpinBox>
#include <QGridLayout>
#include <QLabel>
#include <QTimer>
#include <QCheckBox>
#include <math.h>
#include <iostream>
#define PI 3.14159265

using namespace std;

class QTimeSlice : public QWidget {
    Q_OBJECT
public:
    QTimeSlice();
    virtual ~QTimeSlice();

public slots:
    void setImage(QImage image);
    void setBufferSize(int passed);
    void setRotation(int passed);
    void rotate();
    void getImage();

signals:
    void newImage(QImage image);
private slots:
    void enableRotation(bool passed);
private:
    QRgb getPixel(int x, int y, int z);
    QList<QImage> images;
    int rotation;
    int buffer_size;
    QGridLayout *layout;
    QSpinBox *rotation_spinbox;
    QTimer *timer;
    bool do_rotate_buffer;
    QCheckBox *enable_rotate_buffer;
};

#endif	/* _QTIMESLICE_H */

